.class public Lcom/htc/android/footprints/commonui/ImportDialog;
.super Landroid/app/Activity;
.source "ImportDialog.java"

# interfaces
.implements Landroid/view/View$OnClickListener;


# static fields
.field private static final TAG:Ljava/lang/String; = "ImportDialog"


# instance fields
.field private isClicked:Z

.field private mBtnCancel:Landroid/widget/Button;

.field private mBtnNo:Landroid/widget/Button;

.field private mBtnYes:Landroid/widget/Button;

.field private mChkApplyAll:Landroid/widget/CheckBox;

.field private mDialogContent:Landroid/widget/TextView;

.field private mImportData:Lcom/htc/android/footprints/vo/Footprint;

.field private mTextApplyAll:Landroid/widget/TextView;


# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    .line 21
    invoke-direct {p0}, Landroid/app/Activity;-><init>()V

    .line 32
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/htc/android/footprints/commonui/ImportDialog;->isClicked:Z

    return-void
.end method

.method private getCancelIntent()Landroid/content/Intent;
    .locals 3

    .prologue
    .line 112
    new-instance v0, Landroid/content/Intent;

    invoke-direct {v0}, Landroid/content/Intent;-><init>()V

    .line 113
    .local v0, ret_data:Landroid/content/Intent;
    const-string v1, "isCancelImport"

    const/4 v2, 0x1

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;

    .line 114
    return-object v0
.end method


# virtual methods
.method public onClick(Landroid/view/View;)V
    .locals 5
    .parameter "view"

    .prologue
    const/4 v4, 0x0

    const/4 v3, 0x1

    const-string v2, "isOverwrite"

    .line 76
    new-instance v0, Landroid/content/Intent;

    invoke-direct {v0}, Landroid/content/Intent;-><init>()V

    .line 78
    .local v0, ret_data:Landroid/content/Intent;
    iget-object v1, p0, Lcom/htc/android/footprints/commonui/ImportDialog;->mBtnCancel:Landroid/widget/Button;

    if-ne p1, v1, :cond_1

    .line 79
    const-string v1, "isCancelImport"

    invoke-virtual {v0, v1, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;

    .line 85
    :cond_0
    :goto_0
    const-string v1, "isWaitDialog"

    invoke-virtual {v0, v1, v4}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;

    .line 86
    iput-boolean v3, p0, Lcom/htc/android/footprints/commonui/ImportDialog;->isClicked:Z

    .line 87
    const-string v1, "isApplyAll"

    iget-object v2, p0, Lcom/htc/android/footprints/commonui/ImportDialog;->mChkApplyAll:Landroid/widget/CheckBox;

    invoke-virtual {v2}, Landroid/widget/CheckBox;->isChecked()Z

    move-result v2

    if-eqz v2, :cond_3

    move v2, v3

    :goto_1
    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;

    .line 88
    const/4 v1, -0x1

    invoke-virtual {p0, v1, v0}, Lcom/htc/android/footprints/commonui/ImportDialog;->setResult(ILandroid/content/Intent;)V

    .line 89
    invoke-virtual {p0}, Lcom/htc/android/footprints/commonui/ImportDialog;->finish()V

    .line 90
    return-void

    .line 80
    :cond_1
    iget-object v1, p0, Lcom/htc/android/footprints/commonui/ImportDialog;->mBtnNo:Landroid/widget/Button;

    if-ne p1, v1, :cond_2

    .line 81
    const-string v1, "isOverwrite"

    const/4 v1, 0x2

    invoke-virtual {v0, v2, v1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;

    goto :goto_0

    .line 82
    :cond_2
    iget-object v1, p0, Lcom/htc/android/footprints/commonui/ImportDialog;->mBtnYes:Landroid/widget/Button;

    if-ne p1, v1, :cond_0

    .line 83
    const-string v1, "isOverwrite"

    invoke-virtual {v0, v2, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;

    goto :goto_0

    :cond_3
    move v2, v4

    .line 87
    goto :goto_1
.end method

.method protected onCreate(Landroid/os/Bundle;)V
    .locals 7
    .parameter "savedInstanceState"

    .prologue
    const/4 v6, 0x0

    .line 36
    invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V

    .line 39
    invoke-virtual {p0}, Lcom/htc/android/footprints/commonui/ImportDialog;->getIntent()Landroid/content/Intent;

    move-result-object v1

    const-string v2, "import_data"

    invoke-virtual {v1, v2}, Landroid/content/Intent;->getParcelableExtra(Ljava/lang/String;)Landroid/os/Parcelable;

    move-result-object v1

    check-cast v1, Lcom/htc/android/footprints/vo/Footprint;

    iput-object v1, p0, Lcom/htc/android/footprints/commonui/ImportDialog;->mImportData:Lcom/htc/android/footprints/vo/Footprint;

    .line 41
    const v1, 0x7f030013

    invoke-virtual {p0, v1}, Lcom/htc/android/footprints/commonui/ImportDialog;->setContentView(I)V

    .line 42
    const v1, 0x7f0c006c

    invoke-virtual {p0, v1}, Lcom/htc/android/footprints/commonui/ImportDialog;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/TextView;

    iput-object v1, p0, Lcom/htc/android/footprints/commonui/ImportDialog;->mDialogContent:Landroid/widget/TextView;

    .line 44
    const v1, 0x7f0c0071

    invoke-virtual {p0, v1}, Lcom/htc/android/footprints/commonui/ImportDialog;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/Button;

    iput-object v1, p0, Lcom/htc/android/footprints/commonui/ImportDialog;->mBtnCancel:Landroid/widget/Button;

    .line 45
    const v1, 0x7f0c0070

    invoke-virtual {p0, v1}, Lcom/htc/android/footprints/commonui/ImportDialog;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/Button;

    iput-object v1, p0, Lcom/htc/android/footprints/commonui/ImportDialog;->mBtnNo:Landroid/widget/Button;

    .line 46
    const v1, 0x7f0c006f

    invoke-virtual {p0, v1}, Lcom/htc/android/footprints/commonui/ImportDialog;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/Button;

    iput-object v1, p0, Lcom/htc/android/footprints/commonui/ImportDialog;->mBtnYes:Landroid/widget/Button;

    .line 47
    iget-object v1, p0, Lcom/htc/android/footprints/commonui/ImportDialog;->mBtnCancel:Landroid/widget/Button;

    invoke-virtual {v1, p0}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 48
    iget-object v1, p0, Lcom/htc/android/footprints/commonui/ImportDialog;->mBtnNo:Landroid/widget/Button;

    invoke-virtual {v1, p0}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 49
    iget-object v1, p0, Lcom/htc/android/footprints/commonui/ImportDialog;->mBtnYes:Landroid/widget/Button;

    invoke-virtual {v1, p0}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 50
    const v1, 0x7f0c006d

    invoke-virtual {p0, v1}, Lcom/htc/android/footprints/commonui/ImportDialog;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/CheckBox;

    iput-object v1, p0, Lcom/htc/android/footprints/commonui/ImportDialog;->mChkApplyAll:Landroid/widget/CheckBox;

    .line 51
    iget-object v1, p0, Lcom/htc/android/footprints/commonui/ImportDialog;->mChkApplyAll:Landroid/widget/CheckBox;

    invoke-virtual {v1, v6}, Landroid/widget/CheckBox;->setChecked(Z)V

    .line 52
    const v1, 0x7f0c006e

    invoke-virtual {p0, v1}, Lcom/htc/android/footprints/commonui/ImportDialog;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/TextView;

    iput-object v1, p0, Lcom/htc/android/footprints/commonui/ImportDialog;->mTextApplyAll:Landroid/widget/TextView;

    .line 53
    iget-object v1, p0, Lcom/htc/android/footprints/commonui/ImportDialog;->mTextApplyAll:Landroid/widget/TextView;

    new-instance v2, Landroid/view/TouchDelegate;

    new-instance v3, Landroid/graphics/Rect;

    const/16 v4, 0x64

    const/16 v5, 0x32

    invoke-direct {v3, v6, v6, v4, v5}, Landroid/graphics/Rect;-><init>(IIII)V

    iget-object v4, p0, Lcom/htc/android/footprints/commonui/ImportDialog;->mChkApplyAll:Landroid/widget/CheckBox;

    invoke-direct {v2, v3, v4}, Landroid/view/TouchDelegate;-><init>(Landroid/graphics/Rect;Landroid/view/View;)V

    invoke-virtual {v1, v2}, Landroid/widget/TextView;->setTouchDelegate(Landroid/view/TouchDelegate;)V

    .line 55
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {p0}, Lcom/htc/android/footprints/commonui/ImportDialog;->getResources()Landroid/content/res/Resources;

    move-result-object v2

    const v3, 0x7f0a008c

    invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, "\" "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget-object v2, p0, Lcom/htc/android/footprints/commonui/ImportDialog;->mImportData:Lcom/htc/android/footprints/vo/Footprint;

    iget-object v2, v2, Lcom/htc/android/footprints/vo/Footprint;->mName:Ljava/lang/String;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, "\"?"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    .line 58
    .local v0, showMsg:Ljava/lang/String;
    iget-object v1, p0, Lcom/htc/android/footprints/commonui/ImportDialog;->mDialogContent:Landroid/widget/TextView;

    invoke-virtual {v1, v0}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 59
    return-void
.end method

.method public onKeyDown(ILandroid/view/KeyEvent;)Z
    .locals 3
    .parameter "keyCode"
    .parameter "event"

    .prologue
    const/4 v2, 0x1

    .line 94
    const/4 v0, 0x4

    if-ne p1, v0, :cond_0

    .line 95
    const/4 v0, -0x1

    invoke-direct {p0}, Lcom/htc/android/footprints/commonui/ImportDialog;->getCancelIntent()Landroid/content/Intent;

    move-result-object v1

    invoke-virtual {p0, v0, v1}, Lcom/htc/android/footprints/commonui/ImportDialog;->setResult(ILandroid/content/Intent;)V

    .line 96
    iput-boolean v2, p0, Lcom/htc/android/footprints/commonui/ImportDialog;->isClicked:Z

    .line 97
    invoke-virtual {p0}, Lcom/htc/android/footprints/commonui/ImportDialog;->finish()V

    move v0, v2

    .line 108
    :goto_0
    return v0

    .line 99
    :cond_0
    const/16 v0, 0x13

    if-eq p1, v0, :cond_1

    const/16 v0, 0x14

    if-eq p1, v0, :cond_1

    const/16 v0, 0x15

    if-eq p1, v0, :cond_1

    const/16 v0, 0x16

    if-ne p1, v0, :cond_2

    .line 101
    :cond_1
    iget-object v0, p0, Lcom/htc/android/footprints/commonui/ImportDialog;->mChkApplyAll:Landroid/widget/CheckBox;

    invoke-virtual {v0}, Landroid/widget/CheckBox;->isFocusable()Z

    move-result v0

    if-nez v0, :cond_2

    .line 102
    iget-object v0, p0, Lcom/htc/android/footprints/commonui/ImportDialog;->mChkApplyAll:Landroid/widget/CheckBox;

    invoke-virtual {v0, v2}, Landroid/widget/CheckBox;->setFocusable(Z)V

    .line 103
    iget-object v0, p0, Lcom/htc/android/footprints/commonui/ImportDialog;->mBtnYes:Landroid/widget/Button;

    invoke-virtual {v0, v2}, Landroid/widget/Button;->setFocusable(Z)V

    .line 104
    iget-object v0, p0, Lcom/htc/android/footprints/commonui/ImportDialog;->mBtnNo:Landroid/widget/Button;

    invoke-virtual {v0, v2}, Landroid/widget/Button;->setFocusable(Z)V

    .line 105
    iget-object v0, p0, Lcom/htc/android/footprints/commonui/ImportDialog;->mBtnCancel:Landroid/widget/Button;

    invoke-virtual {v0, v2}, Landroid/widget/Button;->setFocusable(Z)V

    .line 108
    :cond_2
    invoke-super {p0, p1, p2}, Landroid/app/Activity;->onKeyDown(ILandroid/view/KeyEvent;)Z

    move-result v0

    goto :goto_0
.end method

.method protected onPause()V
    .locals 2

    .prologue
    .line 63
    invoke-super {p0}, Landroid/app/Activity;->onPause()V

    .line 64
    iget-boolean v0, p0, Lcom/htc/android/footprints/commonui/ImportDialog;->isClicked:Z

    if-nez v0, :cond_0

    .line 65
    const/4 v0, -0x1

    invoke-direct {p0}, Lcom/htc/android/footprints/commonui/ImportDialog;->getCancelIntent()Landroid/content/Intent;

    move-result-object v1

    invoke-virtual {p0, v0, v1}, Lcom/htc/android/footprints/commonui/ImportDialog;->setResult(ILandroid/content/Intent;)V

    .line 66
    invoke-virtual {p0}, Lcom/htc/android/footprints/commonui/ImportDialog;->finish()V

    .line 68
    :cond_0
    return-void
.end method

.method protected onResume()V
    .locals 0

    .prologue
    .line 72
    invoke-super {p0}, Landroid/app/Activity;->onResume()V

    .line 73
    return-void
.end method
